﻿<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>
        首页
    </title>

    <link rel="shortcut icon" href="favicon.ico"> <link href="/static/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/static/css/animate.css" rel="stylesheet">
    <link href="/static/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/static/css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link href="/static/css/plugins/treeview/bootstrap-treeview.css" rel="stylesheet">
    <link href="/static/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">



    <!-- 全局js -->
    <script src="/static/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/js/bootstrap.min.js?v=3.3.6"></script>


    <!-- Flot -->
    <script src="/static/js/plugins/flot/jquery.flot.js"></script>
    <script src="/static/js/plugins/flot/jquery.flot.tooltip.min.js"></script>
    <script src="/static/js/plugins/flot/jquery.flot.resize.js"></script>

    <script src="/static/js/plugins/toastr/toastr.min.js"></script>



    <!-- 自定义js -->
    <script src="/static/js/content.js?v=1.0.0"></script>


    <!-- ChartJS-->
    <script src="/static/js/plugins/chartJs/Chart.min.js"></script>

    <!-- treeview-->
    <script src="/static/js/plugins/treeview/bootstrap-treeview.js"></script>
    <script src="/static/js/demo/treeview-demo.js"></script>

    <!-- table-->
    <script src="/static/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="/static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="/static/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script script src="/static/js/demo/treeview-demo.js"></script>
    <!-- Peity -->
    <script src="/static/js/plugins/peity/jquery.peity.min.js"></script>

    <!-- Peity demo -->
    <script src="/static/js/demo/peity-demo.js"></script>

</head>

<body class="gray-bg top-navigation">

    <div id="wrapper">
        <div id="page-wrapper" class="gray-bg">
            <div class="row border-bottom white-bg">
                <nav class="navbar navbar-static-top" role="navigation">
                    <div class="navbar-header">
                        <button aria-controls="navbar" aria-expanded="false" data-target="#navbar" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
                            <i class="fa fa-reorder"></i>
                        </button>
                        <a href="#" class="navbar-brand">AutoTester</a>
                    </div>
                    <div class="navbar-collapse collapse" id="navbar">
                        <ul class="nav navbar-nav">
                            <li class="active">
                                <a aria-expanded="false" role="button" href="/autotester">首页</a>
                            </li>
                            <li>
                                <a aria-expanded="false" role="button" href="/autotester/projects"> 项目 </a>
                            </li>
                            <li>
                                <a aria-expanded="false" role="button" href="/autotester/projects"> 测试报告 </a>
                            </li>
                            <li class="dropdown">
                                <a aria-expanded="false" role="button" href="#" class="dropdown-toggle" data-toggle="dropdown"> 设置 <span class="caret"></span></a>
                                <ul role="menu" class="dropdown-menu">
                                    <li><a href="">全局设置</a>
                                    </li>
                                    <li><a href="">变量设置</a>
                                    </li>
                                </ul>
                            </li>

                        </ul>
                        <ul class="nav navbar-top-links navbar-right">
                            {% if request.user.is_authenticated %}
                                 <li>
                                     <a href=#>{{request.user}}</a>
                                 </li>
                                 <li>
                                     <a  href="/autotester/logout?next={{request.get_full_path}}"><i class="fa fa-sign-out"></i>注销</a>
                                 </li>

                            {% else %}
                                <li>
                                <a data-toggle="modal" class="btn btn-white" href="home.html#modal-form">登录</a>
                                </li>
                            {% endif %}
                        </ul>
                    </div>
                </nav>
            </div>
            <div class="wrapper wrapper-content">
                <div class="row">
                    <div class="col-md-2">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>模块列表</h5>
                                <div class="ibox-tools">

                                    <a class="dropdown-toggle" data-toggle="dropdown" href="buttons.html#">
                                        <i class="fa fa-wrench"></i>
                                    </a>
                                    <ul class="dropdown-menu dropdown-user">
                                        <li>
                                            <a href="buttons.html#">选项1</a>
                                        </li>
                                        <li>
                                            <a href="buttons.html#">选项2</a>
                                        </li>
                                    </ul>

                                </div>
                            </div>
                            <div class="ibox-content">
                                <div id="project" class="test treeview">

                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-8">
                        <div class="example-wrap">
                            <h4 class="example-title">Case</h4>
                            <div class="example">

                                <div class="bootstrap-table">
                                    <div class="fixed-table-toolbar">
                                        <div class="bars pull-left">
                                            <div class="btn-group hidden-xs" id="exampleToolbar" role="group">
                                                <button type="button" class="btn btn-outline btn-default">
                                                    <i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
                                                </button>
                                                <button type="button" class="btn btn-outline btn-default" name="del">
                                                    <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
                                                </button>
                                                <button type="button" class="btn btn-outline btn-default">
                                                    <i class="glyphicon glyphicon-play-circle" aria-hidden="true"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="columns columns-right btn-group pull-right">
                                            <button class="btn btn-default btn-outline" type="button" name="refresh"
                                                    title="刷新"><i class="glyphicon glyphicon-repeat"></i></button>
                                            <button class="btn btn-default btn-outline" type="button" name="toggle"
                                                    title="切换"><i class="glyphicon glyphicon-list-alt"></i></button>
                                        </div>
                                        <div class="pull-right search">
                                            <input class="form-control input-outline"
                                                   type="text" placeholder="搜索"></div>
                                    </div>
                                    <div class="fixed-table-container" style="padding-bottom: 0px;">
                                        <div class="fixed-table-header" style="display: none;">
                                            <table></table>
                                        </div>
                                        <div class="fixed-table-body">
                                            <div class="fixed-table-loading" style="top: 37px; display: none;">
                                                正在努力地加载数据中，请稍候……
                                            </div>
                                            <table id="exampleTable" data-mobile-responsive="true"
                                                   class="table table-hover">

                                            </table>
                                        </div>
                                        <div class="fixed-table-footer" style="display: none;">
                                            <table>
                                                <tbody>
                                                <tr></tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <div class="fixed-table-pagination" style="display: none;"></div>
                                    </div>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                        </div>
                    </div>

            </div>
        </div>
            </div>

            <div class="footer">
                <div class="pull-right">
                    By：<a href="http://www.zi-han.net" target="_blank">zihan's blog</a>
                </div>
                <div>
                    <strong>Copyright</strong> H+ &copy; 2014
                </div>
            </div>

        </div>
    </div>



    <div id="modal-form" class="modal fade" aria-hidden="true" style="display: none;">
        <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-6 b-r">
                        <h3 class="m-t-none m-b">登录</h3>

                        <p>欢迎登录本站(⊙o⊙)</p>

                        <form action="/autotester/login" method='post'>
                            {% csrf_token %}
                            <div class="form-group">
                                <label>用户名：</label>
                                <input name='username'  type="text" placeholder="请输入用户名" class="form-control">
                            </div>
                            <div class="form-group">
                                <label>密码：</label>
                                <input name='password' type="password" placeholder="请输入密码" class="form-control">
                            </div>
                            <input name='next' type="hidden" value="{{request.get_full_path}}">
                            <div>

                                <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit">
                                    <strong>登录</strong>
                                </button>
                            </div>
                        </form>
                    </div>
                    <div class="col-sm-6">
                        <h4>还不是会员？</h4>
                        <p>您可以注册一个账户</p>
                        <p class="text-center">
                            <a href="#" onclick="toastr.info('没有功能');"><i class="fa fa-sign-in big-icon"></i></a>
                        </p>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>


    <script type="text/javascript">
        toastr.options = {
          "closeButton": false,
          "debug": false,
          "positionClass": "toast-top-full-width",
          "onclick": null,
          "showDuration": "300",
          "hideDuration": "1000",
          "timeOut": "5000",
          "extendedTimeOut": "1000",
          "showEasing": "swing",
          "hideEasing": "linear",
          "showMethod": "fadeIn",
          "hideMethod": "fadeOut"
            }
    </script>
    <script type="text/javascript">
        var tree = [
            {text:"head",
                nodes:[{
                text: "Parent 1",
                nodes: [
                    {
                        text: "Child 1",
                        nodes: [
                            {
                                text: "Grandchild 1"
                            },
                            {
                                text: "Grandchild 2"
                            }
                        ]
                    },
                    {
                        text: "Child 2"
                    }
                ]
            },
            {
                text: "Parent 2"
            },
            {
                text: "Parent 3"
            },
            {
                text: "Parent 4"
            },
            {
                text: "Parent 5"
            }]
            }

        ];
        $('#project').treeview({
        data: tree
    });


    </script>

    <script type="text/javascript">
        // $('#del')
    </script>

    <script type="text/javascript">

        $('#exampleTable').bootstrapTable({
            columns: [{
                field: 'state',
                checkbox: true,
                align: 'center',
                valign: 'middle'
            },
                {
                field: 'id',
                title: 'Item ID'
            }, {
                field: 'name',
                title: 'Item Name'
            }, {
                field: 'price',
                title: 'Item Price'
            }],
            data: [{
                state:506,
                id: 506,
                name: 'Item 1',
                price: '$1'
            }, {
                state:332,
                id: 332,
                name: 'Item 2',
                price: '$2'
            }, {
                state:331,
                id: 331,
                name: 'Item 3',
                price: '$4'
            }]
        });

        var $remove = $('#exampleToolbar').find('button[name=del]');

        $('#exampleTable').on('check.bs.table uncheck.bs.table', function () {
            $remove.prop('disabled', !$('#exampleTable').bootstrapTable('getSelections').length);
            console.log(1);
        });

        $remove.on('click', function(){
            var selections = $('#exampleTable').bootstrapTable('getSelections');
            selections.forEach(function(item) {
                console.log(item, item.id);
            });
        });

    </script>

</body>

</html>
